        //注销       
        $(function () {
            $('#zx').click(function () {
                if (window.confirm("确定退出吗？")) {
                    location.href = "../index.php";
                }
            });
            //发布项目
            $('#addProject-bc').on('click', function () {
                var file = document.getElementById('Enclosure');
                var fileobj = file.files['0'];
                var form = new FormData();
                form.append('pName', document.getElementById('pName').value);
                form.append('pChar', document.getElementById('pChar').value);
                form.append('teacher', document.getElementById('teacher').value);
                form.append('pDesc', document.getElementById('pDesc').value);
                form.append('pRank', document.getElementById('pRank').value);
                form.append('Enclosure', fileobj);
                $.ajax({
                    type: "POST",
                    url: "declarePro.php",
                    async: false,
                    dataType: "json",
                    data: form,
                    cache: false,
                    processData: false,
                    contentType: false,
                    success: function (msg) {
                        if (msg.status == "1") {
                            alert(msg.mes);
                            location.href = "project-list.php";
                        } else if (msg.status == "-1") {
                            alert(msg.mes);
                            window.location.reload();
                        }
                    },
                    // error: function (XMLHttpRequest, textStatus, errorThrown) {
                    //     alert(XMLHttpRequest.readyState);
                    //     alert(textStatus);
                    // }
                });
            });
            //修改项目
            $('#alertProject').on('click', function () {

                var file = document.getElementById('Enclosure');
                var fileobj = file.files['0'];
                var form = new FormData();
                form.append('pid', document.getElementById('pid').value);
                form.append('pChar', document.getElementById('pChar').value);
                form.append('teacher', document.getElementById('teacher').value);
                form.append('pDesc', document.getElementById('pDesc').value);
                form.append('pRank', document.getElementById('pRank').value);
                form.append('Enclosure', fileobj);
                $.ajax({
                    type: 'POST',
                    url: 'doeditPro.php',
                    //async: false,
                    dataType: "json",
                    cache: false,
                    processData: false,
                    contentType: false,
                    data: form,
                    success: function (msg) {
                        if (msg.status == "1") {
                            alert(msg.mes);
                            location.href = "project-list.php";
                        }
                        else if (msg.status == "-1") {
                            alert(msg.mes);
                            window.location.reload();
                        }
                    },

                });
            });
            //添加项目成员
            $('#addProjectUser-bc').on('click', function () {
                $.ajax({
                    type: "POST",
                    url: "doaddPuser.php",
                    // async: false,
                    dataType: "json",
                    data: $('#addpuser').serialize(),
                    success: function (msg) {
                        if (msg.status == "1") {
                            alert(msg.mes);
                            window.location.href = "alterProjectUser.php";
                        } else if (msg.status == "-1") {
                            alert(msg.mes);
                            window.location.reload();
                        }
                    },
                    // error: function (XMLHttpRequest, textStatus, errorThrown) {
                    //     alert(XMLHttpRequest.readyState);
                    //     alert(textStatus);
                    // }
                });
            });
            //删除项目成员
            $('#uid-del').on('click', function () {
                var uid = $('#uid').text();
                if (window.confirm("确定删除？")) {
                    $.ajax({
                        type: 'GET',
                        url: 'dodelPuser.php',
                        async: false,
                        data: {
                            uid: uid
                        },
                        dataType: JSON,
                        success: function (result) {
                            if (result.status == 1) {
                                alert("删除成功!");
                            }
                            if (result.status == -1) {
                                alert("删除失败!");
                            }
                        },
                        error: function (result) {
                            alert('请求失败!');
                        }
                    });
                }
            });
        });

        //修改密码
        $('#check-pass').on('click', function () {
            $.ajax({
                type: 'POST',
                url: 'changePass.php',
                async: false,
                dataType: "json",
                ContentType: "application/x-www-form-urlencoded; charset=UTF-8",
    
                data: $('#passwdcheck').serialize(),
                success: function (msg) {
                    if (msg.status == 1) {
                        alert(msg.mes);
                    }
                    else if (msg.status == -1) {
                        alert(msg.mes);
                        window.location.reload();
                    }
                },
                // error: function (XMLHttpRequest, textStatus, errorThrown) {
                //     alert(XMLHttpRequest.status);
                //     alert(XMLHttpRequest.readyState);
                //     alert(textStatus);
                // }
            }); 
        });
        //个人信息
        $('#owner-bc').on('click', function () {
            $.ajax({
                type: 'POST',
                url: 'changePass.php',
                async: false,
                dataType: "json",
                ContentType: "application/x-www-form-urlencoded; charset=UTF-8",
    
                data: $('#owner').serialize(),
                success: function (msg) {
                    if (msg.status == 1) {
                        alert(msg.mes);
                    }
                    else if (msg.status == -1) {
                        alert(msg.mes);
                        window.location.reload();
                    }
                },
                // error: function (XMLHttpRequest, textStatus, errorThrown) {
                //     alert(XMLHttpRequest.status);
                //     alert(XMLHttpRequest.readyState);
                //     alert(textStatus);
                // }
            }); 
        });